<script>
  export default {
    name: 'MyFoot',
    props: {
      clearDone: {
        type: Function
      },
      todoList: {
        type: Array
      }
    },
    computed: {
      doneNum() {
        return this.todoList.filter(item => item.status).length
      }
    }
  }
</script>

<template>
    <div class="MyFoot">
      <span>
          已完成{{doneNum}}/全部{{todoList.length}}
          <button @click="clearDone">清除完成的任务</button>
      </span>
    </div>
</template>

 <style scoped>
.MyFoot {
  margin-top: 20px;
  padding: 16px;
  background-color: #f8f8f8;
  border-top: 1px solid #eee;
  text-align: center;
  font-size: 14px;
  color: #555;
}

.MyFoot span {
  display: inline-block;
  padding: 4px 8px;
  background-color: #fff;
  border-radius: 6px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.MyFoot button {
  margin-left: 10px;
  padding: 4px 8px;
  font-size: 12px;
  color: #fff;
  background-color: #ff4d4f;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.MyFoot button:hover {
  background-color: #ff1a1a;
}
</style>

